Skip to content

Fix scripted sequence progression issues and add more developer observability tools#97

Closed
Eldbury wants to merge 7 commits intomodawan:masterfrom
Eldbury:tidy-dev-tools-and-upstream-cleanup
Closed

Fix scripted sequence progression issues and add more developer observability tools#97
Eldbury wants to merge 7 commits intomodawan:masterfrom
Eldbury:tidy-dev-tools-and-upstream-cleanup

Conversation

@Eldbury
Copy link
Copy Markdown

@Eldbury Eldbury commented Apr 19, 2026

Summary

This PR contains a small set of shared-engine fixes that improved early scripted sequence progression in K1, along with developer observability tools surfaced through the existing Developer Mode launcher flow.

Engine fixes

  • call Object::update(dt) from Trigger::update() so trigger-owned delayed actions and queued actions advance correctly
  • fix Area::startDialog() to validate the resolved/final dialogue resref rather than the original empty scripted resref
  • make ClearAllActions() continuation-safe when called from the currently executing assigned action, so the active action chain can complete instead of erasing its own follow-up continuation

These changes were identified while debugging early Endar Spire progression, but they are implemented as shared engine-semantic fixes rather than K1-specific content hacks.

Observed bug fixes

  • Trask now automatically initiates 'locked door' dialogue once he joins the party.
  • Carth cutscene initiates upon traversal of trigger zone outside first locked door
  • Trask / Bandon cutscene now results in Trask entering the hall with Bandon and the door closing

Developer tooling

  • in-game overlay
  • trigger visualization
  • labels overlay
  • watch panel
  • launcher Developer Mode help text:
    • Ctrl+Shift+D overlay
    • Ctrl+Shift+T triggers
    • Ctrl+Shift+A labels
    • Ctrl+Shift+W watch

Validation

  • engine build passed
  • launcher build passed
  • no-game smoke/eval passed
  • K1 smoke/eval passed
  • K2 smoke/eval passed
  • manual verification confirmed restored early scripted handoffs and working dev hotkeys

Copy link
Copy Markdown
Owner

@modawan modawan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @Eldbury! Cutscenes on Endar Spire work much better now, and debug overlay is long overdue.

Comment thread src/libs/game/game.cpp
if (!object) {
return -1;
}
if (auto creature = std::dynamic_pointer_cast<Creature>(object)) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use dyn_cast instead of std::dynamic_pointer_cast to downcast Objects.

Comment thread src/libs/game/game.cpp
for (const auto &localPoint : geometry) {
glm::vec3 worldPoint = trigger->position() + localPoint;
centroid += worldPoint;
glm::vec3 screen = glm::project(worldPoint, view, projection, viewport);
Copy link
Copy Markdown
Owner

@modawan modawan Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something is not right with projections. Running around tar_m02ab, these triggers render incorrectly when the camera points sideways. The trigger is supposed to be across the road.

Image

Comment thread src/libs/game/game.cpp
}

glm::vec3 color = inspected ? glm::vec3(1.0f, 1.0f, 1.0f) : (hostile ? glm::vec3(1.0f, 0.42f, 0.36f) : glm::vec3(0.68f, 0.92f, 1.0f));
std::string label = str(boost::format("#%u %s %s f=%d H=%d sel=%d cmd=%d vis=%d plot=%d") %
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we need all of these values, given that we have info console command. ID, tag, and maybe blueprint are definitely going to be useful. We can keep the rest for now, and remove them later if they turn out to be too distracting.

Comment thread src/libs/game/object.cpp
_executingAction.reset();
throw;
}
_executingAction.reset();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you share more details about the problem? From the PR description:

make ClearAllActions() continuation-safe when called from the currently executing assigned action, so the active action chain can complete instead of erasing its own follow-up continuation

So an action triggered ClearAllActions and removed itself as well? What action can do this?
Can Action::lock help here? Or perhaps we can lock an action before execute?

bool wasLocked = action->locked();
action->lock();
action->execute();
if (!wasLocked) {
  action->unlock();
}

There is no Action::unlock function, but maybe we can add it instead of _executingAction and that new loop above.

@Eldbury
Copy link
Copy Markdown
Author

Eldbury commented Apr 24, 2026

Superseding this mixed PR with separate follow-up PRs per review feedback:

Closing this PR so each review track stays focused by concern.

@Eldbury Eldbury closed this Apr 24, 2026
@Eldbury Eldbury deleted the tidy-dev-tools-and-upstream-cleanup branch April 26, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants